Verifier in Solidity#5
Conversation
Add a Keccak256 transcript hash implementation and update the challenge sampling path to use a single Keccak squeeze with big-endian scalar encoding.
3b29e2d to
35a5064
Compare
Switch the stdlib Poseidon example to the Keccak transcript path, add final-step IVC prove/verify coverage, and publish Solidity verifier fixtures for replay.
Separate verifier options for keeping instance and fold point sets so aggregation and circuit paths can tune verifier MSM length independently.
Expose native verifier trace points across PLONK, KZG, circuit accumulator checks, and transcript wiring so Solidity verifier replay can compare intermediate values.
Move the Solidity verifier generator into the Midfall workspace with codegen, templates, docs, fixtures, scripts, tests, and validated test-command documentation.
35a5064 to
cf89e5f
Compare
With Opus 4.7 (Max settings) |
Review SummaryThe PR introduces a compiler that renders Midnight/Halo2 PLONK verification logic into Solidity verifier contracts. The original PR already covered several important paths: poseidon_fixture.rs: positive end-to-end test for a Poseidon circuit. It generates a valid proof, checks it with the native Rust verifier, renders Solidity, deploys the verifier in the EVM test harness, and confirms the verifier returns true. One clarification from my first attempt: I originally expected different circuits using the same SRS to generate the same Halo2Verifier.sol (except different public data handling), with only Halo2VerifyingKey.sol changing. That assumption was wrong. The generated verifier logic is circuit-shape dependent. Different circuits can have different query layout, rotations, quotient structure, transcript flow, public input layout, and helper contracts. So it is expected that Poseidon, IVC Keccak, RSA, SHA, and Merkle-tree circuits generate different verifier Solidity. My additional testing is in the follow-up branch/PR from solidity-verifier-extra-tests. I added more coverage for: RSA signature circuit DecisionBased on the current testing, this PR looks like a meaningful improvement and I am comfortable moving it forward for merge, staging, and continued integration work. Well done! @jtcoolen. That said, I would avoid making a final production-readiness decision from this PR alone. Once the recursive prover is ready, we should run another focused round of testing against our actual target circuits and generated verifier contracts. After that, we can make a more informed decision about whether the contract is ready to deploy to Sepolia. |
Michael-EY
left a comment
There was a problem hiding this comment.
Very good. Just revert back to using truncated challenges (as we discussed) and I'll approve.
Jira ticket: https://eyblockchain.atlassian.net/browse/GBRD-13?atlOrigin=eyJpIjoiNWEwMzA0YzBmYTQxNGM1ZmE5NmI1ODAzZWZkMzM4YzUiLCJwIjoiaiJ9
What this PR does
It introduces a Keccak transcript and instruments the verifier algorithm in Rust to record an execution trace with the values of intermediate variables.
It introduces a rust library
solidity-verifierunder theproofscrate that generates verifier contracts for a specific verifying key. The relevant documentation can be found in the Jira ticket and underproofs/solidity-verifier/docs, as well as inproofs/solidity-verifier/README.How to test this PR
Append the
--traceflag for the trace equivalence test.IVC example:
Generated contracts under
proofs/solidity-verifier/target/ivc-keccak-solidity-dump/Moonlight proof (ssumes the Moonlight checkout is available at
../Moonlightand is on branchcodex/wrap-bench-cherry-picks).Generated contracts under
proofs/solidity-verifier/target/moonlight-wrap-solidity-dump/PBT tests (located in
proofs/solidity-verifier/src/test.rs):